Search

Nalezeno "pseudo elements": 10

Creating Animated, Clickable Cards With the :has() Relational Pseudo Class


The CSS :has() pseudo class is rolling out in many browsers with Chrome and Safari already fully supporting it. It’s often referred to it as “the parent selector” — as in, we can select style a parent element from a … Creating Animated, Clickable Cards With the :has() Relational Pseudo Class...

Single Element Loaders: The Bars


We’ve looked at spinners. We’ve looked at dots. Now we’re going to tackle another common pattern for loaders: bars. And we’re going to do the same thing in this third article of the series as we have the others … Single Element Loaders: The Bars originally published on CSS-Tricks. You should...

Conditionally Styling Selected Elements in a Grid Container


Calendars, shopping carts, galleries, file explorers, and online libraries are some situations where selectable items are shown in grids (i.e. square lattices). You know, even those security checks that ask you to select all images with crosswalks or whatever. 🧐… Conditionally...

CSS Pseudo Commas


A bonafide CSS trick if there ever was one! @ShadowShahriar created a CodePen demo that uses pseudo-elements to place commas between list items that are displayed inline, and the result is a natural-looking complete sentence with proper punctuation. CodePen Embed… The post CSS Pseudo Commas...

Did You Know About the :has CSS Selector?


File this under stuff you don’t need to know just yet, but I think the :has CSS selector is going to have a big impact on how we write CSS in the future. In fact, if it ever ships in … The post Did You Know About the :has CSS Selector? appeared first on CSS-Tricks. You can support...

Bold on Hover… Without the Layout Shift


When you change the font-weight of a font, the text will typically cause a bit of a layout shift. That’s because bold text is often larger and takes up more space. Sometimes that doesn’t matter, like a vertical stack of links where the wider/bolder text doesn’t push anything...

Pseudo-elements in the Web Animations API


To use the Web Animations API (e.g. el.animate()) you need a reference to a DOM element to target. So, how do you use it on pseudo-elements, which don’t really offer a direct reference? Dan Wilson covers a (newish?) part of the API itself: const logo...

A Little Reminder That Pseudo Elements are Children, Kinda.


Here's a container with some child elements: <div class="container"> <div>item</div> <div>item</div> <div>item</div> </div> If I do: .container::before { content: "x" } I'm essentially doing: <div class="container"> ...

Solved with CSS! Logical Styling Based on the Number of Given Elements


This post is the third in a series about the power of CSS. Article Series: Colorizing SVG Backgrounds Dropdown Menus Logical Styling Based On the Number of Given Elements (this post) Did you know that CSS is Turing complete? Did you know that you can use it to do some pretty serious logical...

Drawing Images with CSS Gradients


What I mean by "CSS images" is images that are created using only HTML elements and CSS. They look as if they were SVGs drawn in Adobe Illustrator but they were made right in the browser. Some techniques I’ve seen used are tinkering with border radii, box shadows, and sometimes clip-path. You...

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace